/*
 * secure.h
 *
 *  Created on: Oct 12, 2011
 *      Author: welcome
 */

#ifndef SECURE_H_
#define SECURE_H_

#include <rdesktop.h>

#ifdef __cplusplus
extern "C" {
#endif

extern void sec_hash_48(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2, uint8 salt);
extern void sec_hash_16(uint8 * out, uint8 * in, uint8 * salt1, uint8 * salt2);
extern void buf_out_uint32(uint8 * buffer, uint32 value);
extern void sec_sign(uint8 * signature, int siglen, uint8 * session_key, int keylen, uint8 * data,
	      int datalen);
extern void sec_decrypt(uint8 * data, int length);
extern STREAM sec_init(uint32 flags, int maxlen);
extern void sec_send_to_channel(STREAM s, uint32 flags, uint16 channel);
extern void sec_send(STREAM s, uint32 flags);
extern void sec_process_mcs_data(STREAM s);
extern STREAM sec_recv(uint8 * rdpver);
extern RD_BOOL sec_connect(char *server, char *username, RD_BOOL reconnect);
extern void sec_disconnect(void);
extern void sec_reset_state(void);

#ifdef __cplusplus
}
#endif
#endif /* SECURE_H_ */
